package com.swpu.service_food.controller;


import com.swpu.commonutils.R;
import com.swpu.service_food.entity.vo.FoodCategoryVo;
import com.swpu.service_food.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chaichai
 * @since 2024-01-26
 */
@RestController
@RequestMapping("/service_food/food")
public class FoodController {

    @Autowired
    private FoodService foodService;
    @GetMapping("/getCategoryList")
    public R getFoodList(){
        List<FoodCategoryVo> foodListInfo = foodService.getFoodListInfo();
        return R.ok().data("categoryList",foodListInfo);
    }
}

